#!/bin/bash

# 设置环境变量
export ANDROID_NDK_HOME=/Users/chenwj/work/ndk/Contents/NDK
export GOOS=android
export GOARCH=arm64
export CGO_ENABLED=1
export GOHOSTARCH=arm64
export GOHOSTOS=android

# 设置编译器路径
export CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android26-clang
export CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android26-clang++

go env 
go build -buildmode=c-shared -o libclient.so libclient.go